﻿using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;

namespace SmartBoard.Core.Networking
{
    public partial class SocketClientSync
    {
        private class SocketClientSyncCryptService : BaseCryptoService
        {
            private readonly SocketClientSync _socketClient;

            public SocketClientSyncCryptService(SocketClientSync client)
            {
                _socketClient = client;
            }

            public override void OnSymmetricAuthenticate(ISocketConnection connection, out RSACryptoServiceProvider serverKey)
            {
                _socketClient.DoOnSymmetricAuthenticate(connection, out serverKey);
            }

            public override void OnSSLClientAuthenticate(ISocketConnection connection, out string serverName, ref X509Certificate2Collection certs, ref bool checkRevocation)
            {
                _socketClient.DoOnSSLClientAuthenticate(connection, out serverName, ref certs, ref checkRevocation);
            }
        }
    }
}
